﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Areas/SystemManage/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        $.ajax({
            url: "/SystemManage/ItemsData/GetFormJson",
            data: { keyValue: keyValue },
            dataType: "json",
            async: false,
            success: function (data) {
                $("#form1").formSerialize(data);
                $("#form1").find('.form-control,select,input').attr('readonly', 'readonly');
                $("#form1").find('div.ckbox label').attr('for', '');
                if (operatType.length > 0) {
                    initControl(data.OperatType, data.ScoreType);

                }
            }
        });

        function initControl(type, scoreType) {
            var encode = "ScoreType";
            if (parseInt(type) == 1) {
                encode = "ScoreType1";
            }
            $("#ScoreType").bindSelect({
                url: "/SysComponent/Controll/GetItemDictionary?enCode=" + encode,
                id: "Code",
                text: "Text"
            });
            $("#ScoreType").val(scoreType);
            //scoreType

        }
    });
</script>
<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        <table class="form">
            @*<tr>
            <th class="formTitle">编号</th>
            <td class="formValue">
                <input id="ItemCode" name="ItemCode" type="text" class="form-control" />
            </td>
        </tr>*@
            <tr>
                <th class="formTitle">用户</th>
                <td class="formValue">
                    <input id="UserName" name="UserName" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">操作类型</th>
                <td class="formValue">
                    <select id="OperatType" name="OperatType" class="input-small inline form-control" style="width: 100px;float:none;display:inline-block;">
                        <option value="">--请选择--</option>
                        <option value="0">获取</option>
                        <option value="1">消费</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">积分类型</th>
                <td class="formValue">
                    <select id="ScoreType" name="ScoreType" class="input-small inline form-control" style="width: 100px;float:none;display:inline-block;">
                        <option value="">--请选择--</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">积分</th>
                <td class="formValue">
                    <input id="Score" name="Score" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">排序</th>
                <td class="formValue">
                    <input id="SortCode" name="SortCode" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle" style="height: 35px;">选项</th>
                <td class="formValue" style="padding-top: 1px;">
                    <div class="ckbox">
                        <input id="IsDefault" name="IsDefault" type="checkbox"><label for="IsDefault">默认</label>
                    </div>
                    <div class="ckbox">
                        <input id="EnabledMark" name="EnabledMark" type="checkbox" checked="checked"><label for="EnabledMark">有效</label>
                    </div>
                </td>
            </tr>
            <tr>
                <th class="formTitle" valign="top" style="padding-top: 5px;">
                    备注
                </th>
                <td class="formValue">
                    <textarea id="Description" name="Description" class="form-control" style="height: 60px;"></textarea>
                </td>
            </tr>
            <tr>
                <th class="formTitle">创建人员</th>
                <td class="formValue">
                    <input id="CreatorUserId" name="CreatorUserId" type="text" class="form-control" />
                </td>
            </tr>
            <tr>

                <th class="formTitle">创建时间</th>
                <td class="formValue">
                    <input id="CreatorTime" name="CreatorTime" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">修改人员</th>
                <td class="formValue">
                    <input id="LastModifyUserId" name="LastModifyUserId" type="text" class="form-control" />
                </td>

            </tr>
            <tr>
                <th class="formTitle">修改时间</th>
                <td class="formValue">
                    <input id="LastModifyTime" name="LastModifyTime" type="text" class="form-control" />
                </td>
            </tr>
        </table>
    </div>
</form>
